JDBI is not very well suited for constructing dynamic queries. IMO the whole point of this library is to separate code and SQL queries as much as possible.
However, your particular case might be solved by means of SQL:
COALESCE(:foo, foo)
if 'foo' is the name of the column in the table, and :foo will resolve to NULL, then mysql SET will be effectively
SET foo=foo
i.e. it will do nothing (which is desired beaviour in your case). If :foo is not null, it will be equivalent to
SET foo=:foo