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