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 (
    32654, 32655, 32656, 32657, 32658, 32659, 
    32660, 32661, 32662, 32663, 32664, 
    32665, 32666, 32667, 32668, 32669, 
    32671, 32672, 32673, 32675, 32676, 
    32677, 32679, 32680, 32681, 32682, 
    32683, 32684, 32685, 32686, 32687, 
    32688
  ) 
  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.00162

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 (32654,32655,32656,32657,32658,32659,32660,32661,32662,32663,32664,32665,32666,32667,32668,32669,32671,32672,32673,32675,32676,32677,32679,32680,32681,32682,32683,32684,32685,32686,32687,32688))",
        "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
32654 155.000000
32655 155.000000
32656 553.000000
32657 553.000000
32658 553.000000
32659 553.000000
32660 553.000000
32661 215.000000
32662 215.000000
32663 215.000000
32664 215.000000
32665 215.000000
32666 215.000000
32667 215.000000
32668 215.000000
32669 215.000000
32671 190.000000
32672 190.000000
32673 190.000000
32675 190.000000
32676 190.000000
32677 190.000000
32679 190.000000
32680 190.000000
32681 190.000000
32682 190.000000
32683 190.000000
32684 190.000000
32685 155.000000
32686 155.000000
32687 155.000000
32688 155.000000