By Assuming the next id as the wanted record may lead to data inconsistencies. It's a bad programming practice to consider assumptions on data and update records.
$query = 'UPDATE ' . $config_table;
$query .= ' SET value="' . $livechat_groups . '"';
$query .= ' WHERE config_id=' . ++$license_id;
$write->query($query);
By Assuming the next id as the wanted record may lead to data inconsistencies. It's a bad programming practice to consider assumptions on data and update records.