UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wJjg/JKh8/dd2rOy3042HAuwap+rBYu+ns+ljupz510='
WHERE
key_id = '3a3cc8e5b123f551a4632051af1bdd3dc9ea69fb08d8f36c9a1af78ab67419bb'
AND (
token = 'wJjg/JKh8/dd2rOy3042HAuwap+rBYu+ns+ljupz510='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)