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 (
    32517, 32518, 32520, 32522, 32523, 32524, 
    32525, 32526, 32527, 32528, 32529, 
    32530, 32532, 32533, 32534, 32535, 
    32537, 32538, 32539, 32540, 32541, 
    32542, 32543, 32544, 32545, 32546, 
    32548, 32549, 32550, 32551, 32552, 
    32553
  ) 
  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.00104

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 (32517,32518,32520,32522,32523,32524,32525,32526,32527,32528,32529,32530,32532,32533,32534,32535,32537,32538,32539,32540,32541,32542,32543,32544,32545,32546,32548,32549,32550,32551,32552,32553))",
        "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
32517 285.000000
32518 285.000000
32520 285.000000
32522 285.000000
32523 285.000000
32524 285.000000
32525 285.000000
32526 285.000000
32527 285.000000
32528 285.000000
32529 285.000000
32530 285.000000
32532 285.000000
32533 285.000000
32534 285.000000
32535 285.000000
32537 285.000000
32538 285.000000
32539 285.000000
32540 285.000000
32541 285.000000
32542 285.000000
32543 285.000000
32544 285.000000
32545 285.000000
32546 285.000000
32548 285.000000
32549 285.000000
32550 285.000000
32551 285.000000
32552 285.000000
32553 285.000000