\set extent 10 * :scale
\setrandom rec 1 :extent

with rej as(insert into foo(a, b) values(:rec, :rec * random()) on duplicate key lock for update returning rejects *) update foo set b = rej.b from rej where foo.a = rej.a;
