UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g5eu7jUb6F/vzG0KJgrtjUcP7TdIvKO4+QG5erw0PMQ='
WHERE
key_id = 'fcc7511cbd5f93e3f6310e25c393d5644c22981493295c9056b21147fb7926b6'
AND (
token = 'g5eu7jUb6F/vzG0KJgrtjUcP7TdIvKO4+QG5erw0PMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)