/carlock and /carunlock should work only if you are inside your own car. As the ID messes at times, so do /carlock and /carunlock.
Due to the dynamic spawning, some car functions do not register the correct ID and will not work properly at all times.