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 (
    29301, 29302, 29303, 29304, 29305, 29306, 
    29307, 29308, 29309, 29310, 29311, 
    29312, 29313, 29314, 29315, 29316, 
    29317, 29318, 29319, 29320, 29321, 
    29322, 29323, 29324, 29325, 29326, 
    29327, 29328, 29329, 29330, 29331, 
    29332
  ) 
  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.00089

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "76.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 (29301,29302,29303,29304,29305,29306,29307,29308,29309,29310,29311,29312,29313,29314,29315,29316,29317,29318,29319,29320,29321,29322,29323,29324,29325,29326,29327,29328,29329,29330,29331,29332))",
        "cost_info": {
          "read_cost": "75.53",
          "eval_cost": "1.28",
          "prefix_cost": "76.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
29301 35.000000
29302 59.000000
29303 62.000000
29304 63.000000
29305 62.000000
29306 81.000000
29307 72.000000
29308 86.000000
29309 35.000000
29310 54.000000
29311 79.000000
29312 89.000000
29313 43.000000
29314 39.000000
29315 107.000000
29316 89.000000
29317 26.000000
29318 62.000000
29319 116.000000
29320 97.000000
29321 68.000000
29322 103.000000
29323 70.000000
29324 14.000000
29325 116.000000
29326 23.000000
29327 153.000000
29328 62.000000
29329 11.000000
29330 30.000000
29331 20.000000
29332 36.000000