I think since this is posted in "Software Programming & Web Scripting" that the original poster is looking for a way to unlock a file via some programming API (as stated in the original post) -- not by directly manipulating the file with the Finder.
tell application "Finder"
set the locked of file "Mac HD:path:to:file" to false
end tell
tell application "Finder"
set the locked of file (posix file "/path/to/file") to false
end tell
SetFile -l /path/to/file