When a statement exceeds the limit the server cancels it with SQLSTATE 57014; the connection stays usable. It can be set per session, role or database. Related: lock timeout.