UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kEr56Qw/6DDpUtakXApaJcxUBPhmJrUSXf9TVAVf4DY='
WHERE
key_id = '860bb509e159bd168ded0ab6d06893ced1df6d394b78d141c2403da14f0bd0f8'
AND (
token = 'kEr56Qw/6DDpUtakXApaJcxUBPhmJrUSXf9TVAVf4DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)