UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7NTlnxbZ9KhCMipc/Dj5dz7ZaYcNk71QexqFbjZRHMQ=' 
WHERE 
  key_id = '4d223bfb65fb9bd8eb9089ee1f71a0ddae82736c31483ed8a83bf90e526e8e81' 
  AND (
    token = '7NTlnxbZ9KhCMipc/Dj5dz7ZaYcNk71QexqFbjZRHMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019