UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Hu0aHMvkJMcmV6FuBkfsp74DZr3/jKUK2RSxBMPEyQ='
WHERE
key_id = 'df18ff1a395e8aaa4d71ca471aa7a39b2ed8111ce313960ed6dcd356fced64ea'
AND (
token = '4Hu0aHMvkJMcmV6FuBkfsp74DZr3/jKUK2RSxBMPEyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)