UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wNxJ3+iDD0T5Sp7N37yIea+r/9STcoK9syXhKiRrSCk='
WHERE
key_id = '85a67ecd4aa88773295bd88c5562dc0c7f1dfd5a26690dbe42b2150c902a8217'
AND (
token = 'wNxJ3+iDD0T5Sp7N37yIea+r/9STcoK9syXhKiRrSCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)