UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D2NnJhsgJIGlPBNCBKbtngfMi8jVuFZCsCH9tqhmKcg=' 
WHERE 
  key_id = '935f8ec62efb2fe153e93faff5db033effa1064bae3d637f85fbf584b5581383' 
  AND (
    token = 'D2NnJhsgJIGlPBNCBKbtngfMi8jVuFZCsCH9tqhmKcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035