UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'am3k5IJOY6QBHvwCh5yIrhJR7bLpDt6dELuzVh1E7Ik='
WHERE
key_id = 'e60a6c9bea1ceb721655e7838f8e6a3274e34904a9c417bdf3981ffefc8e13f1'
AND (
token = 'am3k5IJOY6QBHvwCh5yIrhJR7bLpDt6dELuzVh1E7Ik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)