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

Query time 0.00004

JSON explain

{
  "query_block": {
    "select_id": 1,
    "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 edev.sms-refactory.com N Y N CS-Cart.jp bright_theme N