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