I've been trying to write a massive
$query = $this->model
->whereRaw('created_at <= NOW() - INTERVAL 12 HOUR')
->update(['state' => "timeout"]);
set `state` = timeout, `updated_at` = 2016-09-21 21:47:39
where `state` = pending and created_at <= NOW() - INTERVAL 12 HOUR
where('created_at', DB::raw('NOW() - ..'));
And why are you putting peding in single quotes? Laravel escapes values automatically.