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

Query time 0.00037