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