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 (5374, 5375, 5376, 5377, 5382)

Query time 0.00047

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.13"
    },
    "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": 5,
          "rows_produced_per_join": 5,
          "filtered": "100.00",
          "index_condition": "(`dev2`.`PI`.`product_id` in (5374,5375,5376,5377,5382))",
          "cost_info": {
            "read_cost": "3.01",
            "eval_cost": "0.50",
            "prefix_cost": "3.51",
            "data_read_per_join": "160"
          },
          "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": 5,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "3.12",
            "eval_cost": "0.50",
            "prefix_cost": "7.13",
            "data_read_per_join": "18K"
          },
          "used_columns": [
            "id",
            "path"
          ]
        }
      }
    ]
  }
}

Result

path product_id alt
https://s3.timeweb.cloud/482029f9-prod/products__images/5374_99a08628d6c6_2019GSUi504QG4.webp 5374
https://s3.timeweb.cloud/482029f9-prod/products__images/5375_768002f34fbf_2017EGNY5HZT0d.webp 5375
https://s3.timeweb.cloud/482029f9-prod/products__images/5376_c28fed6bd63a_2021ELKLNGuqHO.webp 5376
https://s3.timeweb.cloud/482029f9-prod/products__images/5377_498b008cb9fb_2022DcRIUHL4PZ.webp 5377
https://s3.timeweb.cloud/482029f9-prod/products__images/5382_4ad43cbcab44_1-2-6-12-13m-coach_04.webp 5382