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
  ) 
  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.00097

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "34.06"
    },
    "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": 49,
        "rows_produced_per_join": 9,
        "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))",
        "cost_info": {
          "read_cost": "33.08",
          "eval_cost": "0.98",
          "prefix_cost": "34.06",
          "data_read_per_join": "235"
        },
        "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
172 0.00000000
173 0.00000000
174 0.00000000
250 0.00000000
251 0.00000000
252 0.00000000
253 0.00000000
254 0.00000000
255 0.00000000
256 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