UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZtDdJF+btVCPS6yh5NX/OL387aFMc9EsIvcLoa5euk='
WHERE
key_id = 'ce157b5e9392ebbb6fc18d8abbcba24dde9b6f75e4604a767dc9c10ac8bd490f'
AND (
token = 'zZtDdJF+btVCPS6yh5NX/OL387aFMc9EsIvcLoa5euk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)