debouncing on the code

Indeed, 600m is ridiculous long. Just have a local uC and let it send the data over RS485. Or, it it's a single buton you can connect it straight to a RS485 driver. RS485 is made for long distance so the drivers will do all the work. To power the driver, send a higher voltage over the line. I would say 12V+ and have a local regulator on the other side.