UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kNXG1y0cDg2XZnIGrEVS1OOGq6uWOomzxBKerZdNmMs='
WHERE
key_id = '69679af59b3efd92a935abfb8ade2d671b59b2ff7b87600202fb4e369804e7d5'
AND (
token = 'kNXG1y0cDg2XZnIGrEVS1OOGq6uWOomzxBKerZdNmMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)