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 (
    32590, 32591, 32592, 32593, 32594, 32595, 
    32596, 32597, 32598, 32599, 32600, 
    32601, 32602, 32603, 32604, 32605, 
    32606, 32607, 32608, 32609, 32610, 
    32611, 32612, 32613, 32614, 32615, 
    32616, 32617, 32618, 32619, 32620, 
    32621
  ) 
  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.00095

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 (32590,32591,32592,32593,32594,32595,32596,32597,32598,32599,32600,32601,32602,32603,32604,32605,32606,32607,32608,32609,32610,32611,32612,32613,32614,32615,32616,32617,32618,32619,32620,32621))",
        "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
32590 215.000000
32591 215.000000
32592 215.000000
32593 215.000000
32594 215.000000
32595 215.000000
32596 207.000000
32597 207.000000
32598 207.000000
32599 259.000000
32600 259.000000
32601 259.000000
32602 259.000000
32603 155.000000
32604 155.000000
32605 155.000000
32606 242.000000
32607 242.000000
32608 242.000000
32609 242.000000
32610 242.000000
32611 242.000000
32612 190.000000
32613 190.000000
32614 190.000000
32615 190.000000
32616 190.000000
32617 190.000000
32618 190.000000
32619 190.000000
32620 352.000000
32621 190.000000