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 (
    9581, 9582, 9583, 9584, 9585, 9586, 9587, 
    9588, 9589, 9590, 9591, 9592, 9593, 
    9594, 9595, 9596, 9597, 9598, 9599, 
    9600, 9601, 9602, 9603, 9604, 9605, 
    9606, 9607, 9608, 9609, 9610, 9611, 
    9612
  ) 
  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.00091

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "92.21"
    },
    "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": 43,
        "rows_produced_per_join": 8,
        "filtered": "19.99",
        "index_condition": "(`portal`.`q_product_prices`.`product_id` in (9581,9582,9583,9584,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612))",
        "cost_info": {
          "read_cost": "90.49",
          "eval_cost": "1.72",
          "prefix_cost": "92.21",
          "data_read_per_join": "206"
        },
        "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
9581 69.000000
9582 179.000000
9583 95.000000
9584 105.000000
9585 109.000000
9586 79.000000
9587 79.000000
9588 119.000000
9589 349.000000
9590 79.000000
9591 109.000000
9592 199.000000
9593 199.000000
9594 199.000000
9595 199.000000
9596 199.000000
9597 199.000000
9598 199.000000
9599 199.000000
9600 269.000000
9601 269.000000
9602 179.000000
9603 129.000000
9604 129.000000
9605 149.000000
9606 199.000000
9607 119.000000
9608 149.000000
9609 149.000000
9610 149.000000
9611 149.000000
9612 199.000000