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 (
    3764, 3749, 6463, 1832, 4038, 734, 3745, 
    2082, 3750, 4604, 188, 3765, 18160, 
    3754, 4047, 4648, 4650, 3747, 2081, 
    3760, 657, 4599, 3756, 4043, 6254, 3753, 
    3767, 3755, 3768, 4637, 4040, 4595
  ) 
  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.01314

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id"
          ],
          "key": "product_id",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "rows": 32,
          "filtered": 99.9960556,
          "index_condition": "cscart_product_prices.product_id in (3764,3749,6463,1832,4038,734,3745,2082,3750,4604,188,3765,18160,3754,4047,4648,4650,3747,2081,3760,657,4599,3756,4043,6254,3753,3767,3755,3768,4637,4040,4595)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
188 257000.0000
657 150000.0000
734 340000.0000
1832 160000.0000
2081 520000.0000
2082 520000.0000
3745 90000.0000
3747 90000.0000
3749 90000.0000
3750 90000.0000
3753 130000.0000
3754 130000.0000
3755 130000.0000
3756 130000.0000
3760 130000.0000
3764 1230000.0000
3765 230000.0000
3767 230000.0000
3768 630000.0000
4038 500000.0000
4040 450000.0000
4043 450000.0000
4047 550000.0000
4595 610000.0000
4599 460000.0000
4604 490000.0000
4637 336000.0000
4648 599000.0000
4650 824000.0000
6254 500000.0000
6463 670000.0000
18160 320000.0000