UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MlS6tCiRfNgvxE+F4lKNKtzFs2rCqiRwXscoB1m9wVU='
WHERE
key_id = '1b4a3cf3f6ebc41934fec9ed94a4131337ab870cda1a0e2fda0011568545ed36'
AND (
token = 'MlS6tCiRfNgvxE+F4lKNKtzFs2rCqiRwXscoB1m9wVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)