SELECT game.*,
vteam.team_city as vteam_city, vteam.team_nick as vteam_nick, vteam.team_abbr as vteam_abbr, vteam.team_logo as vteam_logo,
hteam.team_city as hteam_city, hteam.team_nick as hteam_nick, hteam.team_abbr as hteam_abbr, hteam.team_logo as hteam_logo,
game.bonus ,
(game_lock_date+20000) as gamedate
FROM xf_nflj_pickem_game as game
LEFT JOIN xf_nflj_pickem_team AS vteam
ON (vteam.team_id = game.vteam_id)
LEFT JOIN xf_nflj_pickem_team AS hteam
ON (hteam.team_id = game.hteam_id)
Where (hteam.team_id = ?) or (vteam.team_id = ?)
Having (game_lock_date > UNIX_TIMESTAMP(NOW()) OR UNIX_TIMESTAMP(NOW()) BETWEEN game_lock_date AND gamedate)
order by game_lock_date asc Limit 1