UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/XhnPScYNI2YcvADJ956o5NZ8dK5RlQ8GJ15vKEOrPY='
WHERE
key_id = 'b357c1010f42632da09af823db64194e492c7b62399354f105cde3469e5a7a0d'
AND (
token = '/XhnPScYNI2YcvADJ956o5NZ8dK5RlQ8GJ15vKEOrPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)