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 (
    3874, 38134, 1972, 2287, 2514, 5569, 
    2695, 46751, 44424, 47016, 36329, 455, 
    319, 5546, 48769, 31630, 388, 37304, 
    5556, 16607, 6059, 2920, 38143, 4440, 
    5837, 6060, 27357, 38152, 35249, 2932, 
    27358, 18258
  ) 
  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.19569

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.333330154,
              "attached_condition": "cscart_product_prices.lower_limit <=> 1 and cscart_product_prices.product_id in (3874,38134,1972,2287,2514,5569,2695,46751,44424,47016,36329,455,319,5546,48769,31630,388,37304,5556,16607,6059,2920,38143,4440,5837,6060,27357,38152,35249,2932,27358,18258) and cscart_product_prices.usergroup_id in (0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id price
319 5329000.0000
388 50000.0000
455 3328000.0000
1972 405000.0000
2287 40000.0000
2514 50000.0000
2695 300000.0000
2920 382000.0000
2932 335000.0000
3874 170000.0000
4440 25000.0000
5546 214000.0000
5556 250000.0000
5569 60000.0000
5837 318600.0000
6059 75000.0000
6060 80000.0000
16607 250000.0000
18258 25000.0000
27357 480000.0000
27358 270000.0000
31630 42000.0000
35249 1395000.0000
36329 550000.0000
37304 248000.0000
38134 320000.0000
38143 440000.0000
38152 340000.0000
44424 300000.0000
46751 190000.0000
47016 290000.0000
48769 99000.0000