SELECT 
  q_product_prices.product_id, 
  MIN(
    IF(
      q_product_prices.percentage_discount = 0, 
      q_product_prices.price, 
      q_product_prices.price - (
        q_product_prices.price * q_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  q_product_prices 
WHERE 
  q_product_prices.product_id IN (
    29195, 29201, 29203, 29211, 29212, 29213, 
    29215, 29216, 29223, 29225, 29227, 
    29230, 29233, 29237, 29239, 29242, 
    29243, 29244, 29251, 29252, 29257, 
    29258, 29260, 29270, 29275, 29284, 
    29286, 29288, 29289, 29290
  ) 
  AND q_product_prices.lower_limit = 1 
  AND q_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  q_product_prices.product_id

Query time 0.00091

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "74.81"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "q_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "product_id",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "3",
        "rows_examined_per_scan": 32,
        "rows_produced_per_join": 6,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (29195,29201,29203,29211,29212,29213,29215,29216,29223,29225,29227,29230,29233,29237,29239,29242,29243,29244,29251,29252,29257,29258,29260,29270,29275,29284,29286,29288,29289,29290))",
        "cost_info": {
          "read_cost": "73.53",
          "eval_cost": "1.28",
          "prefix_cost": "74.81",
          "data_read_per_join": "153"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`portal`.`q_product_prices`.`lower_limit` = 1) and (`portal`.`q_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
29195 269.000000
29201 76.000000
29203 87.000000
29211 219.000000
29212 26.000000
29213 48.000000
29215 25.000000
29216 23.000000
29223 88.000000
29225 125.000000
29227 170.000000
29230 179.000000
29233 269.000000
29237 53.000000
29239 117.000000
29242 79.000000
29243 328.000000
29244 152.000000
29251 59.000000
29252 97.000000
29257 124.000000
29258 87.000000
29260 269.000000
29270 32.000000
29275 49.000000
29284 113.000000
29286 60.000000
29288 71.000000
29289 89.000000
29290 44.000000