CDB-3696 new-new logic of locking :)
Merge pull request #650 from CartoDB/CDB-3696

CDB-3696