Stored Procedure taking longer than a normal query
It is usually better to cleanse the data before inserting it into the database.
The query can be sped up in both cases by some rearranging; see below.
Is this the only difference? -- CompanyID = 931 versus CompanyID = Company_ID
Is CompanyID declared BIGINT?
Can you get EXPLAIN output, both in the SP and outside, to help verify the theory that it is easier to work with a number than a parameter passed in.
If you know that there will be no duplicates, use UNION ALL, which is faster.


By moving the WHERE into each SELECT but leaving the `ORDER BY outside, the query is likely to be faster:

( SELECT ... WHERE ... )
UNION [DISTINCT|ALL]
( SELECT ... WHERE ... )
ORDER BY ...


Of the main problem is 931 versus Company_ID, then the solution may involved constructing the query and using prepare and execute.