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 (8858, 8861, 8864, 8934, 8935)

Query time 0.00139

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.12"
    },
    "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 (8858,8861,8864,8934,8935))",
          "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/8858_4b5a7530d9fc_%D0%91%D0%BE%D1%80%D1%82%D0%BE%D0%B2%D0%BE%D0%B9_JAC_120.webp 8858
https://s3.timeweb.cloud/482029f9-prod/products__images/8861_199ada47c50f_%D0%91%D0%BE%D1%80%D1%82%D0%BE%D0%B2%D0%BE%D0%B9_JAC_N90.webp 8861
https://s3.timeweb.cloud/482029f9-prod/products__images/8864_0ac15e7c700f_%D0%91%D0%BE%D1%80%D1%82%D0%BE%D0%B2%D0%BE%D0%B9_JAC_200__1_.webp 8864
https://s3.timeweb.cloud/482029f9-prod/products__images/8934_f6f6452c8448_Z80.webp 8934
https://s3.timeweb.cloud/482029f9-prod/products__images/8935_6fd6dac134f7_Z80_klmr-66.webp 8935