Add lockedAt to database, DB layer and exposed API

Do we/should we/can we delete the previous `emailRecord_1` procedure?

(Also I wish I'd spotted this when we added them, but something like `emailRecord_v2` might make it a little clearer what that number suffix is actually for)