UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'chqi1ft/LLQVihvTgDd4xDUXhJqq4n9YMNjcf6pyetg=' 
WHERE 
  key_id = '7580a50109823021382b96d70f8e9ef6ee35d3b2bd6fb66feeb5df5a749560af' 
  AND (
    token = 'chqi1ft/LLQVihvTgDd4xDUXhJqq4n9YMNjcf6pyetg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023