UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fhtd0upwJhf03SSHYHLuwHxnBnDJV3A2V/xWKwPC8Xw='
WHERE
key_id = '008afc5e1a559d84c457dffbd1faccbbcb727c8c101af8d707fae0cd9b950275'
AND (
token = 'Fhtd0upwJhf03SSHYHLuwHxnBnDJV3A2V/xWKwPC8Xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)