UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0qdh4nX8yPoGC1QWfMMSkJcGC7v1+N/DY5EO7o5r+Yw=' 
WHERE 
  key_id = '471bb8b5aae037963a42fb9c81d84481ec9e0d91a8d4c9541aef8a435c561a27' 
  AND (
    token = '0qdh4nX8yPoGC1QWfMMSkJcGC7v1+N/DY5EO7o5r+Yw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035