UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6xlMEmvt8Pb5gg3rNrUhHk4sQnwznOq7hhkXsFS6Hc='
WHERE
key_id = '61ab942f1ae55c3ed1c002c09c037721799a5253d8bb1f267ecda30eee807e6c'
AND (
token = 'F6xlMEmvt8Pb5gg3rNrUhHk4sQnwznOq7hhkXsFS6Hc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)