SELECT 
  cscart_product_prices.product_id, 
  MIN(
    IF(
      cscart_product_prices.percentage_discount = 0, 
      cscart_product_prices.price, 
      cscart_product_prices.price - (
        cscart_product_prices.price * cscart_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  cscart_product_prices 
WHERE 
  cscart_product_prices.product_id IN (
    172, 173, 174, 250, 251, 252, 253, 254, 
    255, 256, 304, 305, 306, 307, 308, 309, 
    3532, 3533, 3534, 3535, 3536, 3537, 
    3538, 3947, 3948, 3949, 3950, 3951, 
    3952, 3953, 3992, 3993, 3994, 3995, 
    3996, 3997, 3998, 4052, 4053, 4054, 
    4055, 4056, 4057, 4058, 4135, 4136, 
    4137, 4138, 4139, 4140, 4141, 4188, 
    4189, 4190, 4191, 4192, 4193, 4194, 
    29, 30, 31, 32, 33, 34, 35, 76, 77, 78, 
    79, 80, 81, 82, 140, 141, 142, 143, 144, 
    145, 146, 161, 162, 163, 164, 165, 166, 
    167, 243, 244, 245, 246, 247, 248, 249, 
    297, 298, 299
  ) 
  AND cscart_product_prices.lower_limit = 1 
  AND cscart_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  cscart_product_prices.product_id

Query time 0.00158

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "67.66"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_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": 97,
        "rows_produced_per_join": 19,
        "filtered": "20.00",
        "index_condition": "(`gaseus`.`cscart_product_prices`.`product_id` in (172,173,174,250,251,252,253,254,255,256,304,305,306,307,308,309,3532,3533,3534,3535,3536,3537,3538,3947,3948,3949,3950,3951,3952,3953,3992,3993,3994,3995,3996,3997,3998,4052,4053,4054,4055,4056,4057,4058,4135,4136,4137,4138,4139,4140,4141,4188,4189,4190,4191,4192,4193,4194,29,30,31,32,33,34,35,76,77,78,79,80,81,82,140,141,142,143,144,145,146,161,162,163,164,165,166,167,243,244,245,246,247,248,249,297,298,299))",
        "cost_info": {
          "read_cost": "65.72",
          "eval_cost": "1.94",
          "prefix_cost": "67.66",
          "data_read_per_join": "465"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`gaseus`.`cscart_product_prices`.`lower_limit` = 1) and (`gaseus`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
29 0.00000000
30 0.00000000
31 0.00000000
32 0.00000000
33 0.00000000
34 0.00000000
35 0.00000000
76 0.00000000
77 0.00000000
78 0.00000000
79 0.00000000
80 0.00000000
81 0.00000000
82 0.00000000
140 0.00000000
141 0.00000000
142 0.00000000
143 0.00000000
144 0.00000000
145 0.00000000
146 0.00000000
161 0.00000000
162 0.00000000
163 0.00000000
164 0.00000000
165 0.00000000
166 0.00000000
167 0.00000000
172 0.00000000
173 0.00000000
174 0.00000000
243 0.00000000
244 0.00000000
245 0.00000000
246 0.00000000
247 0.00000000
248 0.00000000
249 0.00000000
250 0.00000000
251 0.00000000
252 0.00000000
253 0.00000000
254 0.00000000
255 0.00000000
256 0.00000000
297 0.00000000
298 0.00000000
299 0.00000000
304 0.00000000
305 0.00000000
306 0.00000000
307 0.00000000
308 0.00000000
309 0.00000000
3532 0.00000000
3533 0.00000000
3534 0.00000000
3535 0.00000000
3536 0.00000000
3537 0.00000000
3538 0.00000000
3947 0.00000000
3948 0.00000000
3949 0.00000000
3950 0.00000000
3951 0.00000000
3952 0.00000000
3953 0.00000000
3992 0.00000000
3993 0.00000000
3994 0.00000000
3995 0.00000000
3996 0.00000000
3997 0.00000000
3998 0.00000000
4052 0.00000000
4053 0.00000000
4054 0.00000000
4055 0.00000000
4056 0.00000000
4057 0.00000000
4058 0.00000000
4135 0.00000000
4136 0.00000000
4137 0.00000000
4138 0.00000000
4139 0.00000000
4140 0.00000000
4141 0.00000000
4188 0.00000000
4189 0.00000000
4190 0.00000000
4191 0.00000000
4192 0.00000000
4193 0.00000000
4194 0.00000000