There can be only one setup() and only one loop() in Arduino.
I think the problem with your code is you are sharing key state variables between the code that manages the two sensors, when those two code sections should be completely independent.
I'm not 100% sure, but I suspect you should use takeLowTime1 and takeLowTime2, lowIn1 and lowIn2, lockLow1 and lockLow2.
You have identical code for two sensors, so you have (at least, IMHO) two ways to improve your code.
Use a global array for each state variable (including the pin number), and identify the sensor by its index (i.e. 0 and 1), then encapsulate the code into a function that takes that index as its only argument. In loop(), you call that function twice, once with 0 then with 1 (or use a for() loop).
Or you could encapsulate both the state variables and the function in a class, and give the constructor at least one argument, the sensor pin number.
Then you would instantiate two objects and call each one's function inside loop().
HTH