https://issues.apache.org/jira/browse/AMQ-1191 - apply patch from Mikhail Melamud with thanks. fix up lock statement when isUseLockCreateWhereClause is set