SELECT 
  q_product_prices.product_id, 
  MIN(
    IF(
      q_product_prices.percentage_discount = 0, 
      q_product_prices.price, 
      q_product_prices.price - (
        q_product_prices.price * q_product_prices.percentage_discount
      )/ 100
    )
  ) AS price 
FROM 
  q_product_prices 
WHERE 
  q_product_prices.product_id IN (
    41308, 41309, 41310, 41311, 41312, 41313, 
    41314, 41315, 41317, 41318, 41319, 
    41320, 41321, 41322, 41323, 41324, 
    41325, 41326, 41327, 41328, 41329, 
    41330, 41331, 41332, 41333, 41334, 
    41335, 41336, 41337, 41338
  ) 
  AND q_product_prices.lower_limit = 1 
  AND q_product_prices.usergroup_id IN (0, 1) 
GROUP BY 
  q_product_prices.product_id

Query time 0.00093

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "102.81"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "q_product_prices",
        "access_type": "range",
        "possible_keys": [
          "usergroup",
          "product_id",
          "lower_limit",
          "usergroup_id"
        ],
        "key": "product_id",
        "used_key_parts": [
          "product_id"
        ],
        "key_length": "3",
        "rows_examined_per_scan": 52,
        "rows_produced_per_join": 10,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (41308,41309,41310,41311,41312,41313,41314,41315,41317,41318,41319,41320,41321,41322,41323,41324,41325,41326,41327,41328,41329,41330,41331,41332,41333,41334,41335,41336,41337,41338))",
        "cost_info": {
          "read_cost": "100.73",
          "eval_cost": "2.08",
          "prefix_cost": "102.81",
          "data_read_per_join": "249"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`portal`.`q_product_prices`.`lower_limit` = 1) and (`portal`.`q_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
41308 89.000000
41309 89.000000
41310 89.000000
41311 89.000000
41312 89.000000
41313 75.000000
41314 75.000000
41315 75.000000
41317 75.000000
41318 75.000000
41319 75.000000
41320 89.000000
41321 89.000000
41322 89.000000
41323 89.000000
41324 89.000000
41325 89.000000
41326 89.000000
41327 89.000000
41328 89.000000
41329 89.000000
41330 89.000000
41331 89.000000
41332 62.000000
41333 75.000000
41334 75.000000
41335 89.000000
41336 89.000000
41337 75.000000
41338 75.000000