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 (
    9677, 9678, 9679, 9680, 9681, 9682, 9683, 
    9684, 9685, 9686, 9687, 9688, 9689, 
    9690, 9691, 9692, 9693, 9694, 9695, 
    9696, 9697, 9698, 9699, 9700, 9701, 
    9702, 9703, 9704, 9705, 9706, 9707, 
    9708
  ) 
  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.00101

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 (9677,9678,9679,9680,9681,9682,9683,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9708))",
        "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
9677 189.000000
9678 209.000000
9679 189.000000
9680 125.000000
9681 119.000000
9682 139.000000
9683 279.000000
9684 339.000000
9685 149.000000
9686 125.000000
9687 189.000000
9688 209.000000
9689 229.000000
9690 209.000000
9691 209.000000
9692 209.000000
9693 169.000000
9694 169.000000
9695 189.000000
9696 149.000000
9697 209.000000
9698 189.000000
9699 239.000000
9700 149.000000
9701 149.000000
9702 189.000000
9703 209.000000
9704 189.000000
9705 209.000000
9706 147.000000
9707 189.000000
9708 189.000000