combined 2 SQL queries into one and realized the split between locked/all
tickets in code