UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FMJMWrAVpnu0ctzTtVRhKyvX/i/nOcEtsaCpvahJ6dg='
WHERE
key_id = '9b3960bd64998c191fe088feffd7b67be8b94c6216c941b60f9a0153e24d41a8'
AND (
token = 'FMJMWrAVpnu0ctzTtVRhKyvX/i/nOcEtsaCpvahJ6dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)