UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bE61AE6RANtPuvnGShk4rp9eIpp084h6p3Pv1d4WBMo='
WHERE
key_id = '7462e051c2b05544f95b692449edb251a2a00d9fb13f55f9bd5cacad3053cbad'
AND (
token = 'bE61AE6RANtPuvnGShk4rp9eIpp084h6p3Pv1d4WBMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)