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 (
    3866, 3867, 3868, 3869, 3865, 3870, 3872, 
    3871, 3876, 3862, 3863, 35730, 3864, 
    3861, 35731, 3873, 47984, 3874, 3884, 
    3875, 3880, 3877, 3859, 3879, 35729, 
    3881, 3860, 3883, 3882, 35859
  ) 
  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.00648

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": 30,
          "filtered": 99.9960556,
          "index_condition": "cscart_product_prices.product_id in (3866,3867,3868,3869,3865,3870,3872,3871,3876,3862,3863,35730,3864,3861,35731,3873,47984,3874,3884,3875,3880,3877,3859,3879,35729,3881,3860,3883,3882,35859)",
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,1)"
        }
      }
    ]
  }
}

Result

product_id price
3859 600000.0000
3860 600000.0000
3861 600000.0000
3862 550000.0000
3863 550000.0000
3864 370000.0000
3865 170000.0000
3866 170000.0000
3867 170000.0000
3868 170000.0000
3869 420000.0000
3870 190000.0000
3871 490000.0000
3872 1200000.0000
3873 170000.0000
3874 170000.0000
3875 170000.0000
3876 170000.0000
3877 150000.0000
3879 150000.0000
3880 150000.0000
3881 300000.0000
3882 400000.0000
3883 520000.0000
3884 520000.0000
35729 160000.0000
35730 160000.0000
35731 2000000.0000
35859 800000.0000
47984 600000.0000