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 (
    12259, 12260, 12261, 12262, 12263, 12264, 
    12265, 12266, 12267, 12268, 12269, 
    12270, 12271, 12272, 12273, 12274, 
    12275, 12276, 12277, 12278, 12279, 
    12280, 12281, 12282, 12283, 12284, 
    12285, 12286, 12287, 12288, 12289, 
    12290, 12291, 12292, 12293, 12294, 
    12295, 12296, 12297, 12298, 12299, 
    12300, 12301, 12302, 12303, 12304, 
    12305, 12306, 12307, 12308, 12309, 
    12310, 12311, 12312, 12313, 12314, 
    12315, 12316, 12317, 12318, 12319, 
    12320, 12321, 12322, 12323, 12324, 
    12325, 12326, 12327, 12328, 12329, 
    12330, 12331, 12332, 12333, 12334, 
    12335, 12336, 12337, 12338, 12339, 
    12340, 12341, 12342, 12343, 12344, 
    12345, 12346, 12347, 12348
  ) 
  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.00157

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "63.01"
    },
    "grouping_operation": {
      "using_filesort": false,
      "table": {
        "table_name": "cscart_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": 90,
        "rows_produced_per_join": 17,
        "filtered": "19.99",
        "index_condition": "(`test2_gaseus`.`cscart_product_prices`.`product_id` in (12259,12260,12261,12262,12263,12264,12265,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12284,12285,12286,12287,12288,12289,12290,12291,12292,12293,12294,12295,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,12320,12321,12322,12323,12324,12325,12326,12327,12328,12329,12330,12331,12332,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348))",
        "cost_info": {
          "read_cost": "61.21",
          "eval_cost": "1.80",
          "prefix_cost": "63.01",
          "data_read_per_join": "431"
        },
        "used_columns": [
          "product_id",
          "price",
          "percentage_discount",
          "lower_limit",
          "usergroup_id"
        ],
        "attached_condition": "((`test2_gaseus`.`cscart_product_prices`.`lower_limit` = 1) and (`test2_gaseus`.`cscart_product_prices`.`usergroup_id` in (0,1)))"
      }
    }
  }
}

Result

product_id price
12259 622.80000000
12260 622.80000000
12261 622.80000000
12262 622.80000000
12263 622.80000000
12264 622.80000000
12265 622.80000000
12266 622.80000000
12267 622.80000000
12268 622.80000000
12269 622.80000000
12270 622.80000000
12271 622.80000000
12272 622.80000000
12273 622.80000000
12274 622.80000000
12275 622.80000000
12276 622.80000000
12277 622.80000000
12278 622.80000000
12279 622.80000000
12280 622.80000000
12281 622.80000000
12282 622.80000000
12283 622.80000000
12284 622.80000000
12285 622.80000000
12286 622.80000000
12287 622.80000000
12288 622.80000000
12289 622.80000000
12290 622.80000000
12291 622.80000000
12292 622.80000000
12293 622.80000000
12294 622.80000000
12295 622.80000000
12296 622.80000000
12297 622.80000000
12298 622.80000000
12299 622.80000000
12300 622.80000000
12301 622.80000000
12302 622.80000000
12303 622.80000000
12304 405.50000000
12305 405.50000000
12306 405.50000000
12307 405.50000000
12308 405.50000000
12309 405.50000000
12310 405.50000000
12311 405.50000000
12312 405.50000000
12313 405.50000000
12314 405.50000000
12315 405.50000000
12316 405.50000000
12317 405.50000000
12318 405.50000000
12319 405.50000000
12320 405.50000000
12321 405.50000000
12322 405.50000000
12323 405.50000000
12324 405.50000000
12325 405.50000000
12326 405.50000000
12327 405.50000000
12328 405.50000000
12329 405.50000000
12330 405.50000000
12331 405.50000000
12332 405.50000000
12333 405.50000000
12334 405.50000000
12335 405.50000000
12336 405.50000000
12337 405.50000000
12338 405.50000000
12339 405.50000000
12340 405.50000000
12341 405.50000000
12342 405.50000000
12343 405.50000000
12344 405.50000000
12345 405.50000000
12346 405.50000000
12347 405.50000000
12348 405.50000000