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 (
    34828, 34928, 39919, 39920, 39921, 38856, 
    38600, 38601, 35779, 35599, 35600, 
    30985, 31040, 30389, 30968, 30969, 
    30971, 30972, 30974, 30976, 30977, 
    30986, 30989, 31041, 31045, 31046, 
    31047, 31048, 31051
  ) 
  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.00319

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "69.61"
    },
    "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": 29,
        "rows_produced_per_join": 5,
        "filtered": "19.89",
        "index_condition": "(`ea201_diorama`.`cscart_product_prices`.`product_id` in (34828,34928,39919,39920,39921,38856,38600,38601,35779,35599,35600,30985,31040,30389,30968,30969,30971,30972,30974,30976,30977,30986,30989,31041,31045,31046,31047,31048,31051))",
        "cost_info": {
          "read_cost": "68.46",
          "eval_cost": "1.15",
          "prefix_cost": "69.61",
          "data_read_per_join": "138"
        },
        "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
30389 8.80000000
30968 5.20000000
30969 5.20000000
30971 5.15000000
30972 5.16000000
30974 5.20000000
30976 5.20000000
30977 5.16000000
30985 6.15000000
30986 29.70000000
30989 8.91000000
31040 11.30000000
31041 10.30000000
31045 10.35000000
31046 10.31000000
31047 10.35000000
31048 10.35000000
31051 10.30000000
34828 13.20000000
34928 12.90000000
35599 11.50000000
35600 11.55000000
35779 5.70000000
38600 10.80000000
38601 11.00000000
38856 6.90000000
39919 10.10000000
39920 8.70000000
39921 9.20000000