Prevent race conditions on custom-data update

PLAT-739 #time 30m