Try like this
SET @rownum =0;
SELECT id,brand_id FROM
(
SELECT
products.id, products.brand_id, @rownum := @rownum + 1 AS rank
FROM products
JOIN (
SELECT id, brand_id
from products limit 10)
pinner ON products.id = pinner.id
WHERE pinner.brand_id IN ('1', '2','3')
) AS T
Where rank < 10