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

Query time 0.00033