Under some circumstances it might be legal, under others it might not.
I think your situation falls under the Commercial Rental Property statute:
https://statutes.capitol.texas.gov/D.../htm/PR.93.htm
I'm not going to take the time to analyze it. If you read it carefully, I think what amounts to a lock out would subject you to a civil lawsuit for the penalties outlined in the statute.
Don't take any chances.
Have your rental agreement reviewed by a lawyer and have the lawyer handle the eviction in the proper manor.

