Does this query run slowly when you run it directly on the sql server as well?
Try using this query instead:
SELECT DISTINCT ps3_products.ProductID, COALESCE(ps3_productoptions.GroupingID,ps3_product s.ProductID) AS GroupingID FROM ps3_products LEFT OUTER JOIN ps3_productoptions ON ps3_productoptions.ProductID = ps3_products.ProductID WHERE ps3_products.ProductID = 7504 OR ps3_productoptions.GroupingID = (SELECT GroupingID FROM ps3_productoptions WHERE ProductID = 7504 LIMIT 1)