SELECT 
  storefronts.* 
FROM 
  cscart_storefronts AS storefronts 
WHERE 
  1 = 1 
  AND (
    storefronts.url = 'shavgun.com' 
    OR storefronts.url = 'www.shavgun.com' 
    OR storefronts.url LIKE 'www_.shavgun.com' 
    OR storefronts.url LIKE 'shavgun.com/%' 
    OR storefronts.url LIKE 'www.shavgun.com/%' 
    OR storefronts.url LIKE 'www_.shavgun.com/%'
  ) 
GROUP BY 
  storefronts.storefront_id 
ORDER BY 
  storefronts.url = 'shavgun.com' DESC, 
  storefronts.url = 'www.shavgun.com' DESC, 
  storefronts.url LIKE 'www_.shavgun.com' DESC, 
  storefronts.url LIKE 'shavgun.com/%' DESC, 
  storefronts.url LIKE 'www.shavgun.com/%' DESC, 
  storefronts.url LIKE 'www_.shavgun.com/%' desc

Query time 0.00032

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "storefronts",
          "access_type": "system",
          "rows": 1,
          "filtered": 100
        }
      }
    ]
  }
}

Result

storefront_id url redirect_customer is_default status access_key name theme_name is_accessible_for_authorized_customers_only
1 shavgun.com N Y N CS-Cart responsive N