Parameter placeholders in JDBC are defined using ? not $1 - but you don't need any parameter placeholders for the UPDATE part to begin with, because you can reference the values using the excluded keyword.
"INSERT INTO " + this.table+ " VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "
+ "ON CONFLICT (uid) DO UPDATE SET "
+ "(id, rt, rid, ls, chn, ...
It looks like your lock function or key needs to take into account who set and who can release the lock (i.e. an owner). Perhaps by using a randomly generated ID. With a specific lock owner each thread has to verify that they are the owner when they set a lock and when they release a lock.