UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QROcvp6IY0D0hK/WATlwkI0dGRIUoDVw6lrFy1qL+u8='
WHERE
key_id = 'c398c642f71b2fd8728ac7c34a91786f0573dad319db1b2a1838447f8b71055e'
AND (
token = 'QROcvp6IY0D0hK/WATlwkI0dGRIUoDVw6lrFy1qL+u8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)