I have never created meta boxes myself, but looking at your code all you do is trying to update meta but you need to add it first with add_post_meta
.
Check this article on How To Create Custom Post Meta Boxes In WordPress.
For your issue, pay attention to Saving the meta box data section. As you can see, their function uses add_post_meta
, update_post_meta
and delete_post_meta
functions.