Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
The locked drive means that either the drive is encrypted and locked or the partition structure has corrupted and in some cases, it means that the hard drive is physicall failing.
There is a way to completely erase it and setup fresh. Remember, this will delete all partitions of hard drive which means delete everything from it. Follow the steps below;
Disconnect all external hard drives from your Mac. Then in the OS X installation screen (main screen), click on Utilities menu at the top bar and select Terminal.
Type the following and press return
diskutil cs list
It will show some list of drives. Copy the UUID of Logical Volume Group*. UUID is some alphanumeric characters
Then type the following and press return
diskutil cs delete typeUUIDoflogicalvolume group here (or you can copy and paste it here)
Then press return. This will erase everything from the drive. Then open Disk Utility and erase it as Mac OS Journaled/Extended. Then reinstall OS X.
Please let me know if that didn't work, so we can continue troubleshooting