Key<StatRecord> key = StatRecord.getKey(playerId, stat.getCode());
// update the row in the database only if it has the expected modCount
int numRows = updatePartial(
StatRecord.class,
new Where(StatRecord.PLAYER_ID, playerId,
StatRecord.STAT_CODE, stat.getCode(),
StatRecord.MOD_COUNT, stat.getModCount()),
key,
StatRecord.STAT_DATA, data, StatRecord.MOD_COUNT, nextModCount);