SELECT 
  cscart_product_prices.product_id, 
  COALESCE(
    cscart_master_products_storefront_min_price.price, 
    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 
  LEFT JOIN cscart_master_products_storefront_min_price ON cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id 
  AND cscart_master_products_storefront_min_price.storefront_id = 1 
WHERE 
  cscart_product_prices.product_id IN (
    157878, 
    131244, 
    163555, 
    142795, 
    152834, 
    139304, 
    140470, 
    161677, 
    137204, 
    150431, 
    173467, 
    122494, 
    174303, 
    176633, 
    155460, 
    152788, 
    159979, 
    152387, 
    177902, 
    146542, 
    148127, 
    155163, 
    146233, 
    130037, 
    130745, 
    151021, 
    128287, 
    143111, 
    155514, 
    124685, 
    170152, 
    148944, 
    151780, 
    133106, 
    145497, 
    145180, 
    173179, 
    128213, 
    174680, 
    146818, 
    170999, 
    131696, 
    171673, 
    131951, 
    166209, 
    165386, 
    172481, 
    141152, 
    123413, 
    128274, 
    167042, 
    171994, 
    166489, 
    154484, 
    128340, 
    166263, 
    135458, 
    155044, 
    148326, 
    143307, 
    139706, 
    124396, 
    172334, 
    121219, 
    173565, 
    147677, 
    177514, 
    141410, 
    122327, 
    142464, 
    155085, 
    164296, 
    136827, 
    176060, 
    130512, 
    149075, 
    137444, 
    142067, 
    136299, 
    135240, 
    137144, 
    165641, 
    137493, 
    122588, 
    125079, 
    121137, 
    175250, 
    130713, 
    129259, 
    153437, 
    148372, 
    141211, 
    160027, 
    137205, 
    147933, 
    138696, 
    158978, 
    124484, 
    138587, 
    130862, 
    149784, 
    136011, 
    136213, 
    142966, 
    165523, 
    118369, 
    139067, 
    129348, 
    165171, 
    119815, 
    136217, 
    170004, 
    123533, 
    126063, 
    155865, 
    161288, 
    136896, 
    135083, 
    176947, 
    166994, 
    134428, 
    175167, 
    162335, 
    137156, 
    143428, 
    130486, 
    151548, 
    142017
  ) 
  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.00191

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.525449254,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_prices",
          "access_type": "range",
          "possible_keys": [
            "usergroup",
            "product_id",
            "lower_limit",
            "usergroup_id",
            "wdbi_product_id_lower_limit_usergroup_id_price_eff1727beeef",
            "wdbi_usergroup_id_lower_limit_product_id_92b7e8f6a250",
            "wdbi_product_id_lower_limit_usergroup_id_price_perc_3b2301d551d0",
            "wdbi_lower_limit_usergroup_id_product_id_b93629431718"
          ],
          "key": "usergroup",
          "key_length": "9",
          "used_key_parts": ["product_id", "usergroup_id", "lower_limit"],
          "loops": 1,
          "rows": 256,
          "cost": 0.44592136,
          "filtered": 20,
          "attached_condition": "cscart_product_prices.lower_limit = 1 and cscart_product_prices.product_id in (157878,131244,163555,142795,152834,139304,140470,161677,137204,150431,173467,122494,174303,176633,155460,152788,159979,152387,177902,146542,148127,155163,146233,130037,130745,151021,128287,143111,155514,124685,170152,148944,151780,133106,145497,145180,173179,128213,174680,146818,170999,131696,171673,131951,166209,165386,172481,141152,123413,128274,167042,171994,166489,154484,128340,166263,135458,155044,148326,143307,139706,124396,172334,121219,173565,147677,177514,141410,122327,142464,155085,164296,136827,176060,130512,149075,137444,142067,136299,135240,137144,165641,137493,122588,125079,121137,175250,130713,129259,153437,148372,141211,160027,137205,147933,138696,158978,124484,138587,130862,149784,136011,136213,142966,165523,118369,139067,129348,165171,119815,136217,170004,123533,126063,155865,161288,136896,135083,176947,166994,134428,175167,162335,137156,143428,130486,151548,142017) and cscart_product_prices.usergroup_id in (0,1)"
        }
      },
      {
        "table": {
          "table_name": "cscart_master_products_storefront_min_price",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "8",
          "used_key_parts": ["product_id", "storefront_id"],
          "ref": [
            "u985510652_ecartify_abhi.cscart_product_prices.product_id",
            "const"
          ],
          "loops": 51.2,
          "rows": 1,
          "cost": 0.046614528,
          "filtered": 100,
          "attached_condition": "trigcond(cscart_master_products_storefront_min_price.product_id = cscart_product_prices.product_id)"
        }
      }
    ]
  }
}

Result

product_id price
118369 1853.10000000
119815 1399.98000000
121137 81.05000000
121219 1557.99000000
122327 1169.06000000
122494 1766.41000000
122588 789.09000000
123413 833.90000000
123533 10.16000000
124396 1821.92000000
124484 1303.89000000
124685 1150.12000000
125079 1249.78000000
126063 1899.66000000
128213 480.60000000
128274 743.14000000
128287 81.87000000
128340 631.20000000
129259 452.92000000
129348 546.42000000
130037 1849.46000000
130486 1058.68000000
130512 1141.92000000
130713 1778.71000000
130745 96.20000000
130862 239.14000000
131244 433.71000000
131696 49.32000000
131951 1506.82000000
133106 430.62000000
134428 1152.90000000
135083 1259.60000000
135240 1371.57000000
135458 365.27000000
136011 1991.65000000
136213 467.02000000
136217 1818.20000000
136299 1838.34000000
136827 1231.12000000
136896 900.61000000
137144 194.44000000
137156 603.83000000
137204 585.61000000
137205 1473.83000000
137444 162.43000000
137493 1280.01000000
138587 1371.66000000
138696 1444.31000000
139067 892.98000000
139304 1281.69000000
139706 1286.50000000
140470 1318.85000000
141152 1378.19000000
141211 490.24000000
141410 1777.46000000
142017 898.08000000
142067 962.60000000
142464 577.85000000
142795 1952.52000000
142966 587.03000000
143111 574.78000000
143307 1841.93000000
143428 1225.10000000
145180 1254.75000000
145497 1738.98000000
146233 609.78000000
146542 819.25000000
146818 1494.19000000
147677 834.34000000
147933 487.80000000
148127 532.21000000
148326 423.72000000
148372 855.69000000
148944 1084.80000000
149075 17.76000000
149784 394.58000000
150431 400.75000000
151021 84.07000000
151548 329.43000000
151780 1996.63000000
152387 662.62000000
152788 1809.97000000
152834 1744.20000000
153437 1937.47000000
154484 1392.62000000
155044 38.56000000
155085 1017.48000000
155163 755.21000000
155460 780.49000000
155514 892.83000000
155865 792.86000000
157878 264.85000000
158978 505.69000000
159979 329.56000000
160027 678.03000000
161288 1259.95000000
161677 1544.96000000
162335 1301.64000000
163555 955.50000000
164296 153.41000000
165171 989.02000000
165386 344.93000000
165523 1396.12000000
165641 831.57000000
166209 387.45000000
166263 614.58000000
166489 1629.64000000
166994 1842.47000000
167042 1876.82000000
170004 184.82000000
170152 417.05000000
170999 1302.21000000
171673 1744.02000000
171994 368.27000000
172334 196.99000000
172481 1362.40000000
173179 140.09000000
173467 1235.77000000
173565 846.41000000
174303 842.84000000
174680 1742.05000000
175167 538.48000000
175250 867.62000000
176060 1694.19000000
176633 1541.17000000
176947 1306.78000000
177514 1285.80000000
177902 1516.14000000