UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gl8TeY6XHSKGIRMxinDKXb/m1RiYRmg4HtaZ8HyIpXU='
WHERE
key_id = '5576df8b07ff47448a7ba5a276ef5d1753d46613aeb60d100e83a7a4fb736ed0'
AND (
token = 'Gl8TeY6XHSKGIRMxinDKXb/m1RiYRmg4HtaZ8HyIpXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)