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 (
    30702, 30703, 30704, 30705, 30706, 30707, 
    30708, 30709, 30710, 30711, 30712, 
    30713, 30714, 30715, 30716, 30717, 
    30718, 30719, 30720, 30721, 30722, 
    30723, 30724, 30725, 30726, 30727, 
    30728, 30729, 30730, 30731, 30732, 
    30733
  ) 
  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.00288

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "78.21"
    },
    "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": 33,
        "rows_produced_per_join": 6,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (30702,30703,30704,30705,30706,30707,30708,30709,30710,30711,30712,30713,30714,30715,30716,30717,30718,30719,30720,30721,30722,30723,30724,30725,30726,30727,30728,30729,30730,30731,30732,30733))",
        "cost_info": {
          "read_cost": "76.89",
          "eval_cost": "1.32",
          "prefix_cost": "78.21",
          "data_read_per_join": "158"
        },
        "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
30702 104.000000
30703 43.000000
30704 43.000000
30705 206.000000
30706 324.000000
30707 43.000000
30708 27.000000
30709 80.000000
30710 151.000000
30711 61.000000
30712 31.000000
30713 38.000000
30714 22.000000
30715 229.000000
30716 31.000000
30717 49.550000
30718 33.000000
30719 34.000000
30720 110.000000
30721 112.000000
30722 53.000000
30723 45.000000
30724 125.000000
30725 19.000000
30726 1620.000000
30727 53.000000
30728 250.000000
30729 48.000000
30730 58.000000
30731 40.000000
30732 42.000000
30733 32.000000