Update first, if not then insert (mysql)
This is possible with MySQL command line "Load data file". But it no SQL query.

13.2.6 LOAD DATA INFILE Syntax
https://dev.mysql.com/doc/refman/5.7/en/load-data.html