האם זה בסדר לעדכן את external_id במסד הנתונים של discourse?

Yes, you should be able to do that, but you should fix the real problem first

for instance when accounts are being merged always make sure the lowest ID is assigned / used.