UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmFHpCvlwcdvaBV0yj4LoXqVagAWlzaoytNpAzofTuE='
WHERE
key_id = '11d33220cb8a265f8bac9476548e0e07b89a9bd7d3aeee0cce72e676ec2d2722'
AND (
token = 'qmFHpCvlwcdvaBV0yj4LoXqVagAWlzaoytNpAzofTuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)