I need help resolving a retrieval problem
varbinary can be used directly in a SQL range:

SELECT d.ADDRESS,
       i.country,
       i.area,
       i.city
FROM download AS d
INNER JOIN ip_lookup AS i
   ON d.ADDRESS BETWEEN i.start_ip AND i.end_ip
      AND length(d.ADDRESS) = length(i.start_ip)
WHERE d.FILENAME IS NOT NULL
  AND d.country IS NULL;


The lengths are a double check they are comparing same IP versions. It may not be needed.

To ensure the ip_lookups are quick

CREATE INDEX ip_range ON ip_lookup (start_ip, end_ip)


If you aren't using the id of ip_range maybe the above should be the primary key.