SELECT 
  `F`.`path`, 
  `PI`.`product_id`, 
  `PI`.`alt` 
FROM 
  `cscart_products__images` AS `PI` 
  LEFT JOIN `files` AS `F` ON `PI`.`watermark_small_file_id` = `F`.`id` 
WHERE 
  `PI`.`product_id` IN (8254, 8833, 14465, 25291, 27424)

Query time 0.00032

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "8.32"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "PI",
          "access_type": "range",
          "possible_keys": [
            "product_id"
          ],
          "key": "product_id",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "rows_examined_per_scan": 6,
          "rows_produced_per_join": 6,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (8254,8833,14465,25291,27424))",
          "cost_info": {
            "read_cost": "3.36",
            "eval_cost": "0.60",
            "prefix_cost": "3.96",
            "data_read_per_join": "192"
          },
          "used_columns": [
            "product_id",
            "watermark_small_file_id",
            "alt"
          ]
        }
      },
      {
        "table": {
          "table_name": "F",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "4",
          "ref": [
            "dev2.PI.watermark_small_file_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 6,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "3.77",
            "eval_cost": "0.60",
            "prefix_cost": "8.33",
            "data_read_per_join": "22K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/8254_aa67d511faf4_2_q2bk-w7.webp 8254
https://s3.timeweb.cloud/482029f9-prod/products__images/8254_d39a71e517f6_photo_2023-04-13_13-25-27.webp 8254
https://s3.timeweb.cloud/482029f9-prod/products__images/8833_2a2996ed80c5_WhatsApp_Image_2023-08-11_at_12.16.21.webp 8833
https://s3.timeweb.cloud/482029f9-prod/products__images/14465_7eeefaa4cf28_32338_15d6187a3b0b_14465_953449b10369_2_d6cq-61_l49w-yd.webp 14465
https://s3.timeweb.cloud/482029f9-prod/products__images/25291_be8850e0cdfb_%D0%A0%D0%B8%D1%81%D1%83%D0%BD%D0%BE%D0%BA3_ie99-tp_g0ub-r4.webp 25291
https://s3.timeweb.cloud/482029f9-prod/products__images/27424_0a2880093bf8_%D0%A0%D0%B8%D1%81%D1%83%D0%BD%D0%BE%D0%BA1_mjgw-mp_x6um-rv_4oyn-wh.webp 27424