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 (
    2867, 2868, 2869, 2870, 2871, 2872, 2873, 
    2874, 2875, 2876, 2877, 2878, 2879, 
    2880, 2717, 2718, 2719, 2720, 2721, 
    2722, 2723, 2725, 2726, 2727, 2728, 
    2729, 2730, 2731, 2732, 2733
  ) 
  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.00071

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.01"
    },
    "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": 30,
        "rows_produced_per_join": 5,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2717,2718,2719,2720,2721,2722,2723,2725,2726,2727,2728,2729,2730,2731,2732,2733))",
        "cost_info": {
          "read_cost": "70.81",
          "eval_cost": "1.20",
          "prefix_cost": "72.01",
          "data_read_per_join": "143"
        },
        "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
2717 1059.000000
2718 1725.000000
2719 665.000000
2720 709.000000
2721 685.000000
2722 755.000000
2723 549.000000
2725 555.000000
2726 469.000000
2727 605.000000
2728 705.000000
2729 479.000000
2730 755.000000
2731 535.000000
2732 815.000000
2733 779.000000
2867 79.000000
2868 189.000000
2869 189.000000
2870 205.000000
2871 259.000000
2872 155.000000
2873 155.000000
2874 155.000000
2875 165.000000
2876 249.000000
2877 269.000000
2878 279.000000
2879 159.000000
2880 225.000000