UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lXz7zxBnJKCWss2TAM1XsannevJ3lfdYSxRjUFKCOKo=' 
WHERE 
  key_id = 'a3a7837b611623654b0a851d258220511acb1a0019aa8cb5d73476d39b237199' 
  AND (
    token = 'lXz7zxBnJKCWss2TAM1XsannevJ3lfdYSxRjUFKCOKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035