Add two columns to the user data table for a failed attempt counter and last login date/time. On an unsuccessful login, increment the counter and save the current date/time. On a successful login, if the counter >= 3 and date/time + 60min <= now(), then do not log them in and display an error, else reset the counter to 0 and let them in.