UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43zzcJbriMHDbXvCRmUoFOjNk2EfERafbo07gfLMGGE=' 
WHERE 
  key_id = '584a84ed63a39fe555a6e4055d88f4302135f9d0b1b87740164bfc1f4e79414b' 
  AND (
    token = '43zzcJbriMHDbXvCRmUoFOjNk2EfERafbo07gfLMGGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024