UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qHUahC2Equj8jM8n42UdktpS7JgG4NtQ3smxlE1Ox3Y='
WHERE
key_id = 'c33501ebe6fb73055f4acd7c91e1bb928eb937753f98d68d5bab74e4dbe61b81'
AND (
token = 'qHUahC2Equj8jM8n42UdktpS7JgG4NtQ3smxlE1Ox3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)