you can do as below
@userValid bit out
AS
BEGIN
SET NOCOUNT ON;
IF EXISTS(SELECT * FROM TblAppUser Where Email = @AppUserEmail and UserPassword = @AppUserPassword)
BEGIN
SET @AppUserID =(Select UserId From TblAppUser Where Email = @AppUserEmail and UserPassword = @AppUserPassword)
SET @AppUsername =(Select UserName From TblAppUser Where Email = @AppUserEmail and UserPassword = @AppUserPassword)
SET @LastLoginDate = (Select ISNULL(LastLoginDate,GetDate()) From TblAppUser Where Email = @AppUserEmail and UserPassword = @AppUserPassword)
Update TblAppUser Set LastLoginDate = GetDate() Where Email = @AppUserEmail and UserPassword = @AppUserPassword
Set @userValid = 1
END
ELSE
Set @userValid = 0
END