Is it possible to change between SELECT column based on an "IF" statement? and use INNER JOIN variables?
SELECT (IF 'mapped_products'.'product_id' USE 'product_id_to_name'.'product_name' ELSE `non_mapped_products`.`product_name` ) 
FROM `non_mapped_products`
WHERE EXISTS ( SELECT 1  FROM `orders_history` WHERE `orders_history`.`product_id` = `non_mapped_products`.`product_id`)


can be re-written to:

SELECT COALESCE( product_id_to_name.product_name,  non_mapped_products.product_name ) 
FROM non_mapped_products
    WHERE EXISTS ( SELECT 1  
                   FROM orders_history 
                   WHERE orders_history.product_id = non_mapped_products.product_id)
LEFT JOIN product_id_to_name ON  
    product_id_to_name.product_id = orders_history.product_id