Yeah you can do it through the SharedTableData - RenameKey.
var stringTableCollection = LocalizationEditorSettings.GetStringTableCollection("My Game Text");
stringTableCollection.SharedData..RenameKey("Old name", "New Name");
// Mark the asset dirty so that Unity saves the changes
EditorUtility.SetDirty(stringTableCollection.SharedData);
var text = go.GetComponent<TMPro.TMP_Text>();
var localizer = go.GetComponent<GameObjectLocalizer>();
var trackedObject = localizer.GetTrackedObject(text);
foreach(var prop in trackedObject.TrackedProperties)
{
if (prop is LocalizedStringProperty stringProp)
{
var collection = LocalizationEditorSettings.GetStringTableCollection(stringProp.LocalizedString.TableReference);
var entry = collection.SharedData.GetEntryFromReference(stringProp.LocalizedString.TableEntryReference);
Debug.Log("old name " + entry.Key);
collection.SharedData.RenameKey(entry.Id, "New Name");
EditorUtility.SetDirty(collection.SharedData);
}
}