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 (
    6129, 5152, 834, 47083, 46749, 5461, 
    41390, 35187, 5158, 1408, 31626, 40760, 
    19289, 4247, 6141, 41594, 6136, 1747, 
    5998, 2497, 5154, 6131, 6147, 5476, 
    3223, 6537, 3712, 3747, 295, 1764, 1875, 
    2233
  ) 
  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.14404

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "cscart_product_prices.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_product_prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "lower_limit",
              "key_length": "3",
              "used_key_parts": ["lower_limit"],
              "ref": ["const"],
              "rows": 25327,
              "filtered": 8.080804825,
              "attached_condition": "cscart_product_prices.lower_limit <=> 1 and cscart_product_prices.product_id in (6129,5152,834,47083,46749,5461,41390,35187,5158,1408,31626,40760,19289,4247,6141,41594,6136,1747,5998,2497,5154,6131,6147,5476,3223,6537,3712,3747,295,1764,1875,2233) and cscart_product_prices.usergroup_id in (0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id price
295 600000.0000
834 55000.0000
1408 305000.0000
1747 189000.0000
1764 280000.0000
1875 79000.0000
2233 899000.0000
2497 395000.0000
3223 129000.0000
3712 395000.0000
3747 90000.0000
4247 45000.0000
5152 60000.0000
5154 60000.0000
5158 300000.0000
5461 2200000.0000
5476 1280000.0000
5998 620000.0000
6129 379000.0000
6131 179000.0000
6136 239000.0000
6141 199000.0000
6147 49000.0000
6537 95000.0000
19289 129000.0000
31626 110000.0000
35187 699000.0000
40760 579000.0000
41390 450000.0000
41594 399000.0000
46749 480000.0000
47083 320000.0000