UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F99EIRQyuN/8OZcc9JtcM+owlP8XaVQkxECCN6+OgDA=' 
WHERE 
  key_id = '1c831a990f921a94ba8037cb9868117d5f5f6fc991bb2de0f618f234a014c233' 
  AND (
    token = 'F99EIRQyuN/8OZcc9JtcM+owlP8XaVQkxECCN6+OgDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033