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 (
    38558, 3168, 6063, 3663, 40452, 2294, 
    44939, 5553, 3230, 1123, 41170, 112, 
    2286, 3916, 1429, 3170, 36746, 5834, 
    6062, 47085, 6211, 3471, 4072, 5567, 
    5141, 6052, 47902, 36729, 3880, 4280, 
    6057, 27362
  ) 
  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.19584

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 (38558,3168,6063,3663,40452,2294,44939,5553,3230,1123,41170,112,2286,3916,1429,3170,36746,5834,6062,47085,6211,3471,4072,5567,5141,6052,47902,36729,3880,4280,6057,27362) and cscart_product_prices.usergroup_id in (0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id price
112 145000.0000
1123 538000.0000
1429 280000.0000
2286 35000.0000
2294 220000.0000
3168 340000.0000
3170 450000.0000
3230 129000.0000
3471 999000.0000
3663 350000.0000
3880 150000.0000
3916 1342000.0000
4072 300000.0000
4280 70000.0000
5141 60000.0000
5553 250000.0000
5567 70000.0000
5834 211680.0000
6052 155000.0000
6057 80000.0000
6062 75000.0000
6063 80000.0000
6211 535000.0000
27362 420000.0000
36729 350000.0000
36746 240000.0000
38558 528000.0000
40452 590000.0000
41170 225000.0000
44939 117000.0000
47085 2080000.0000
47902 398000.0000