UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xrzbAWKTMs/5luBfkd/+aF1wy3Soq/+NG7MxZLmvMy4='
WHERE
key_id = '691336a3c62b8bcb4dda5d175a9b346a362d61255d1f404c32bce760c6100e20'
AND (
token = 'xrzbAWKTMs/5luBfkd/+aF1wy3Soq/+NG7MxZLmvMy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)