UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLeKxeFJlo5vaMVCyoBfBIDapYkGGGbEYT44cRcq2qw='
WHERE
key_id = '45264508e0b0d6c929d51d55ab3f614c482c6c2e622e3e714c3a555933e3f84d'
AND (
token = 'JLeKxeFJlo5vaMVCyoBfBIDapYkGGGbEYT44cRcq2qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)