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 (
    34835, 37789, 39361, 34820, 40466, 40398, 
    40351, 38316, 39325, 40308, 39613, 
    38314, 37788, 36045, 39878, 39611, 
    39354, 39353, 39299, 39300, 39268, 
    38317, 39137, 39138, 39139, 39058, 
    38994, 39313, 37790, 38179
  ) 
  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.00070

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "74.81"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_product_prices",
        "access_type": "range",
        "possible_keys": [
          "membership",
          "src_k",
          "product_id",
          "lower_limit",
          "membership_id"
        ],
        "key": "product_id",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "3",
        "rows_examined_per_scan": 32,
        "rows_produced_per_join": 6,
        "filtered": "19.89",
        "index_condition": "(`ea201_diorama`.`cscart_product_prices`.`product_id` in (34835,37789,39361,34820,40466,40398,40351,38316,39325,40308,39613,38314,37788,36045,39878,39611,39354,39353,39299,39300,39268,38317,39137,39138,39139,39058,38994,39313,37790,38179))",
        "cost_info": {
          "read_cost": "73.54",
          "eval_cost": "1.27",
          "prefix_cost": "74.81",
          "data_read_per_join": "152"
        },
        "used_columns": [
          "product_id",
          "price",
          "lower_limit",
          "usergroup_id",
          "percentage_discount"
        ],
        "attached_condition": "((`ea201_diorama`.`cscart_product_prices`.`lower_limit` = 1) and (`ea201_diorama`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
34820 12.60000000
34835 20.69000000
36045 11.70000000
37788 12.60000000
37789 12.60000000
37790 12.60000000
38179 12.60000000
38314 19.90000000
38316 19.95000000
38317 8.36000000
38994 42.71000000
39058 24.16000000
39137 17.16000000
39138 26.71000000
39139 25.71000000
39268 14.11000000
39299 15.16000000
39300 7.71000000
39313 19.95000000
39325 16.20000000
39353 21.70000000
39354 25.20000000
39361 15.15000000
39611 25.75000000
39613 26.95000000
39878 17.99000000
40308 17.16000000
40351 5.20000000
40398 27.20000000
40466 40.20000000