UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2aQjPZuefWw+LHvDZ8zAdtnUb95h0rp2ZiZk50RDww=' 
WHERE 
  key_id = '8f2f981fab93f96032ed49397654d81526c24e7af6a0564e3e0e50d5be19f0f8' 
  AND (
    token = '+2aQjPZuefWw+LHvDZ8zAdtnUb95h0rp2ZiZk50RDww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032