UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0kPVoil7eZP1AEzjXuYA9Ojd6qTzhNKA+q7+OjFw9vo=' 
WHERE 
  key_id = '17e6b44c5ffaec2eb9af42dd342c4994aad30b369fc713832ea4859b254618ab' 
  AND (
    token = '0kPVoil7eZP1AEzjXuYA9Ojd6qTzhNKA+q7+OjFw9vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045