The newer versions of SQLite support an ON CONFLICT clause to INSERT that will do what you want. If there is a conflict, e.g., a field or fields that are supposed to unique, the statement will execute the instructions in ON CONFLICT instead.
The current SQLite plugin does not yet support this version, at least on the desktop, but once it does, this will do what you want.