Du kan enkelt sortera resultaten efter antalet matcher:
SELECT `id`
FROM `accounts`
WHERE AES_DECRYPT(`email`, '123') = CONCAT_WS('@', 'test', 'test.com') OR
AES_DECRYPT(`email`, '123') LIKE CONCAT('%','test.com')
ORDER BY ( (AES_DECRYPT(`email`, '123') = CONCAT_WS('@', 'test', 'test.com')) +
(AES_DECRYPT(`email`, '123') LIKE CONCAT('%','test.com'))
);
Detta kommer att fungera för ditt exempel.