The best you can really do is select “Pin Tab” from the Window menu, but you do NOT have control of where the pinned tab goes.
Safari WON'T let you change the URL of a pinned tab.
You'd have to unpin the tab, change the URL, re-pin the tab, and then somehow move it from the end of the pinned-tab-queue back to the front.
The latter would require some Found-Image action finesse and drag and drop, or it looks like you can find the positions of the pinned tabs with AppleScript UI-Scripting.
tell application "System Events"
tell application process "Safari"
tell (first window whose subrole is "AXStandardWindow")
tell tab group 1
tell (first radio button whose role description is "pinned tab")
set firstPinnedTabPosition to its position
tell (last radio button whose role description is "pinned tab")
set lastPinnedTabPosition to its position