Why is my command throwing a 'data tag parsing failed' error?

Solution 1:

As of 1.12 you have to encase Strings containing special characters (including spaces and apostrophes) with quotes (" ").

/blockdata 10 4 9 {Lock:"Elyiana's Mage Key"}

This should do the trick.