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 (
    32881, 32882, 32883, 32884, 32885, 32886, 
    32887, 32888, 32889, 32890, 32891, 
    10533, 10532, 10531, 10530, 10529, 
    10524, 10521, 8380, 8381, 8383, 8384, 
    8385, 8386, 8387, 8388, 8389, 8390, 
    8391, 8392, 8393, 8394
  ) 
  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.00088

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "96.41"
    },
    "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": 46,
        "rows_produced_per_join": 9,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (32881,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,10533,10532,10531,10530,10529,10524,10521,8380,8381,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394))",
        "cost_info": {
          "read_cost": "94.57",
          "eval_cost": "1.84",
          "prefix_cost": "96.41",
          "data_read_per_join": "220"
        },
        "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
8380 299.000000
8381 299.000000
8383 399.000000
8384 445.000000
8385 459.000000
8386 399.000000
8387 399.000000
8388 319.000000
8389 399.000000
8390 399.000000
8391 309.000000
8392 309.000000
8393 309.000000
8394 309.000000
10521 25.000000
10524 25.000000
10529 25.000000
10530 25.000000
10531 29.000000
10532 32.000000
10533 49.000000
32881 163.000000
32882 163.000000
32883 207.000000
32884 207.000000
32885 328.000000
32886 328.000000
32887 328.000000
32888 259.000000
32889 259.000000
32890 328.000000
32891 328.000000