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 (
    31913, 31915, 31924, 31902, 31909, 31899, 
    31916, 31922, 31928, 31930, 31932, 
    31903, 31917, 31905, 31914, 31918, 
    31919, 31921, 31964, 31839, 31842, 
    31845, 31908, 31910, 31911, 31912, 
    31925, 31931, 31933, 31934
  ) 
  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.00370

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.01"
    },
    "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": 30,
        "rows_produced_per_join": 5,
        "filtered": "19.89",
        "index_condition": "(`ea201_diorama`.`cscart_product_prices`.`product_id` in (31913,31915,31924,31902,31909,31899,31916,31922,31928,31930,31932,31903,31917,31905,31914,31918,31919,31921,31964,31839,31842,31845,31908,31910,31911,31912,31925,31931,31933,31934))",
        "cost_info": {
          "read_cost": "70.82",
          "eval_cost": "1.19",
          "prefix_cost": "72.01",
          "data_read_per_join": "143"
        },
        "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
31839 5.90000000
31842 6.16000000
31845 5.90000000
31899 10.11000000
31902 10.11000000
31903 10.11000000
31905 13.11000000
31908 10.11000000
31909 10.11000000
31910 9.81000000
31911 9.81000000
31912 9.81000000
31913 9.81000000
31914 9.81000000
31915 9.81000000
31916 9.81000000
31917 9.81000000
31918 9.81000000
31919 9.81000000
31921 9.81000000
31922 9.81000000
31924 9.81000000
31925 9.81000000
31928 9.81000000
31930 9.81000000
31931 9.81000000
31932 9.81000000
31933 9.81000000
31934 9.81000000
31964 8.81000000